import { Line } from 'zrender';
import { CoordinateSystem } from './CoordinateSystem';
import { CsElement, CsElementOption } from './CsElement';



export class XYAxis extends CsElement {

  constructor(cs: CoordinateSystem, option: Partial<CsElementOption> = {}) {
    super(cs, Object.assign({
      show: true,
      z: 0
    }, option))

    const { root } = this
    root.add(new Line({
      silent: true,
      z: this._option.z,
      shape: {
        x1: -99999999,
        x2: 99999999,
      },
      style: {
        stroke: '#ff0000',
        lineWidth: 1,
        strokeNoScale: true,
      }
    }))

    root.add(new Line({
      silent: true,
      z: this._option.z,
      shape: {
        y1: -99999999,
        y2: 99999999,
      },
      style: {
        stroke: '#00ff00',
        lineWidth: 1,
        strokeNoScale: true,
      }
    }))
  }
  protected _onDestroy(): void {
    throw new Error('Method not implemented.');
  }
}